package oracle;

import java.sql.*;

public class 作业 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("oracle.jdbc.OracleDriver");
        String username="system";//Oracle用户名
        String password="d20050913";//Oracle密码
        String url="jdbc:oracle:thin:@127.0.0.1:1521:XE";//Oracle链接
        Connection con= DriverManager.getConnection(url,username,password);
        System.out.println("是否连接"+con);
        String sql="insert into  login values(4,'段静茹','12345678912')";
        Statement st=con.createStatement();
        int  rows=st.executeUpdate(sql);
        System.out.println("增加了"+rows+"条记录");
        st.close();
        con.close();
    }
}